<?php
		
	/* SVN FILE: $Id: username.autocomplete.php 8 2011-03-13 08:32:38Z michele.andreoletti@gmail.com $ */
	
	/**
	 * Project Name : arcadia
	 *
	 * @author $Author: michele.andreoletti@gmail.com $
	 * @version $Revision: 8 $
	 * @lastrevision $Date: 2011-03-13 08:32:38 +0000 (Sun, 13 Mar 2011) $
	 * @filesource $URL: http://arcadia.googlecode.com/svn/trunk/include/username.autocomplete.php $
	 */
	
	require_once './functions.php';
	require_once './const.inc.php';
	require_once './auth.inc.php';
	require_once './conn.inc.php';
	
	fnOnly4Sysop();
		
	$aOutput = array();

	fnGetValueFromGET(array('term'));
	
	$sQuery = "SELECT * FROM `users` WHERE `sUsername` LIKE '$term%' ORDER BY `sUsername`";
	
	$aResult = custom_mysql_query ($sQuery);
	
	while ($aRow = mysql_fetch_array ($aResult)) {
		$aOutput[] = array("value" => strip_tags($aRow['sUsername']));
	}
	
	echo array_to_json($aOutput);
	die();

?>


